Deep learning phase error correction for cerebrovascular 4D flow MRI

Background phase errors in 4D Flow MRI may negatively impact blood flow quantification. In this study, we assessed their impact on cerebrovascular flow volume measurements, evaluated the benefit of manual image-based correction, and assessed the potential of a convolutional neural network (CNN), a form of deep learning, to directly infer the correction vector field. With IRB waiver of informed consent, we retrospectively identified 96 MRI exams from 48 patients who underwent cerebrovascular 4D Flow MRI from October 2015 to 2020. Flow measurements of the anterior, posterior, and venous circulation were performed to assess inflow-outflow error and the benefit of manual image-based phase error correction. A CNN was then trained to directly infer the phase-error correction field, without segmentation, from 4D Flow volumes to automate correction, reserving from 23 exams for testing. Statistical analyses included Spearman correlation, Bland–Altman, Wilcoxon-signed rank (WSR) and F-tests. Prior to correction, there was strong correlation between inflow and outflow (ρ = 0.833–0.947) measurements with the largest discrepancy in the venous circulation. Manual phase error correction improved inflow-outflow correlation (ρ = 0.945–0.981) and decreased variance (p < 0.001, F-test). Fully automated CNN correction was non-inferior to manual correction with no significant differences in correlation (ρ = 0.971 vs ρ = 0.982) or bias (p = 0.82, Wilcoxon-Signed Rank test) of inflow and outflow measurements. Residual background phase error can impair inflow-outflow consistency of cerebrovascular flow volume measurements. A CNN can be used to directly infer the phase-error vector field to fully automate phase error correction.

www.nature.com/scientificreports/ from a variety of sources can impair velocity measurements and subsequent flow quantifications 7 . Some factors, such as Maxwell terms and gradient field non-linearity, can be corrected automatically 8,9 . However, other factors, including induced electromagnetic eddy currents are difficult to model, and may impact flow measurements [10][11][12] (Fig. 1), though some investigators have questioned their significance in certain neurovascular applications 13 . To address eddy currents, investigators have suggested using active gradient shielding and non-conducting structural components 11 in addition to adjusting sequence parameters such as slew rate 14 ; these design practices are now commonplace for modern scanners. Alternative methods include the use of stationary phantoms 7,15 , but these solutions can be complicated to implement clinically and may not effectively address the phase errors present at the time of the patient flow acquisition 16 .
Other studies have evaluated methods for modeling background phase error using the velocities of voxels within static regions. Both manual and semi-automated image-based approaches that leverage static tissue have been described 17 . The impact of these methods on flow measurements differs between studies and can be affected by the amount of static tissue 7,13,18,19 . Image-based methods each require some degree of manual background tissue segmentation, which can be time-consuming 20 and difficult to incorporate into the clinical workflow.
Deep learning has emerged as a powerful technique to automate a variety of computer vision tasks in MRI. In particular, convolutional neural networks (CNNs), though predominantly explored for image classification or segmentation 21,22 , can be used for other tasks including super-resolution and image enhancement 23,24 . In this study, we propose an alternative use of CNNs, combining their ability to recognize visual features and execute computational tasks. We hypothesized that a CNN may be able to recognize and directly infer the phase error correction vector field, without segmentation, for cerebrovascular 4D Flow MRI. Thus, we sought first to assess the benefit of image-based phase-error correction on inflow-outflow error [25][26][27] , an important metric for internal consistency of flow measurements. We subsequently assessed the potential of a CNN to automatically infer the phase-error correction field and compared the effectiveness of this approach to manual image-based phase-error correction.

Methods
Institutional review board approval. Institutional review board approval with waiver of informed consent was obtained from the UCSD Institutional Review Boards for this retrospective, observational, HIPAA compliant, single-institution study. All methods were carried out in accordance with relevant guidelines and regulations and all experimental protocols were approved by the UCSD Institutional Review Boards. All patients who underwent 4D Flow MRI as part of follow-up of cerebral AVMs before and after stereotactic radiosurgery (SRS) between October 2015 and October 2020 were included in the study. No additional exclusion criteria were applied. MRI examinations from a total of 48 patients, 24 females and 24 males, were included. The average age of patients at the time of the scan was 42 years (range: 14-78) and median Spetzler-Martin (SM) grade of AVMs was 3 (range: 1-5). On average, patients underwent two 4D Flow scans (range: 1-5).

Image acquisition.
Patients underwent 4D Flow MRI on a 3T GE Discovery 750 MRI scanner (GE Healthcare, Milwaukee, Wisconsin) using a 16-channel head/neck/spine coil. Gadobenate dimeglumine 0.1 mmol/kg was administered intravenously for magnetic resonance angiography, prior to 4D Flow to benefit blood pool enhancement. 4D Flow images were acquired using a parallel-imaging compressed-sensing variant with variable-density Poisson sampling and ESPIRiT reconstruction [28][29][30] with the following parameters: mean temporal resolution 130 ms (93-254), acquired in-plane spatial resolution 1.11 × 0.97 mm (1.07-1.88 × 0.94-1.88), velocity encoding (VENC) 193 cm/s (100-200 cm/s), maximum slew rate of 120 T/m/s, and total acceleration factor of 1.8 (1.4-2.0) in the phase direction and 2.0 (1.4-2.0) in the slice direction for a mean scan time of 7 min and 45 s. We note that there is often higher velocity blood flow present in intracranial AVMs 5,31 and at our institution, we have found by clinical experience that higher VENCs around 200 cm/sec prevent aliasing in these regions. Figure 1. Improvement in flow visualization and flow quantification following manual background phase error correction. In a 33-year-old female, a Spetzler-Martin grade 4 AVM in the right basal ganglia (white arrow) is shown on (A) 3D TOF MRA and in oblique sagittal views with 4D Flow MRI (B and C). Low velocity arrows are seen in the soft tissues in (B), which decrease after phase error correction in (C). There is a discrepancy between venous inflow in the superior sagittal (red solid arrow) and straight (red dotted arrow) sinuses and venous outflow in the left (orange solid arrow) and right (orange dotted arrow) transverse sinuses prior to correction (0.48 + 0.21 > 0. 36  www.nature.com/scientificreports/ Background phase error correction. Background error correction was performed in two steps. First, corrections for Maxwell terms and gradient field non-linearity were automatically corrected inline with image reconstruction 8,9 . Second, manual phase error correction was performed in Arterys Cardio AI v2.2 (Arterys, San Francisco, CA). Specifically, 3D contours were manually drawn in each 4D Flow dataset to exclude regions of spatial wrap and non-static tissues e.g., the arteries of the Circle of Willis and venous sinuses, to isolate static soft tissue for modeling of background phase error. The background phase error was then calculated in Arterys using patchwise linear regression of the static tissue velocities 10 . This latter background phase error field, derived from the manual phase error correction step, was used as ground truth for CNN training. In other words, the CNN algorithm was trained with data necessary to replace the manual phase error correction step.
CNN algorithm development. Patients were randomly partitioned into training and testing groups. Each MRI scan comprised 20 cardiac phases, with the velocity field at each cardiac phase corresponding to a single temporal volume. Of the 48 total patients who each underwent multiple MRI exams over the course of their clinical care, 73 MRI scans comprised of 1,460 temporal volumes from 37 patients (17 females and 20 males) were selected as training and validation data, and 23 MRI scans comprised of 460 temporal volumes from 11 patients (7 females and 4 males) were reserved for independent testing. A multi-channel CNN with a 3D-UNet architecture 32 (Fig. 2) was developed to directly infer background phase error correction from image volumes, without static tissue segmentation. CNN training was performed on a workstation running Ubuntu 18.04 (Canonical, London, UK) and equipped with four Quadro GV100 graphics cards (Nvidia, Mountain View, California). TensorFlow-GPU 2.1.0 (Google, Mountain View, California) was used for all deep learning experiments. 4D Flow MRI velocity and magnitude data were first partitioned into individual timepoints and linearly downsampled to 64 × 64 × 64 image volumes and supplied as four input channels. We performed downsampling due to GPU memory constraints. The CNN was then trained to simultaneously infer the correction for each velocity direction in three 64 × 64 × 64 output channels, defined by: where, − → ε is the correction field. − → v * is the corrected velocity field. − → v is the uncorrected velocity field.
For training, we minimized the difference between the CNN-predicted and manually-corrected correction fields using the mean squared error loss function and Adam optimization (learning rate 1 × 10 -4 ). We trained our CNN for a maximum of 300 epochs using early stopping and halted training if the validation set loss failed to decrease for 40 epochs. The code for the model architecture is available on request at https:// github. com/ AiDAL abUCSD/ Neuro-Phase-Error-Corre ction; GitHub login required.

Automated (CNN) background phase error correction.
To apply the CNN inferred phase error correction to the source uncorrected velocity field, we employed two additional post-processing steps. First, CNNinferred phase errors (64 × 64 × 64 volumes) were fit to a third-order polynomial using least-squares regression to reduce spurious local inference errors. We then scaled the step size of the polynomial to match the original input velocity field resolution and interpolated the correction field at native resolution. This correction field was then added to uncorrected velocity data to compute the corrected velocity field. In other words, we apply the CNN to estimate the corrected field, − → v * ≈ − → v + ε , where ε is the 3rd order polynomial fit of CNN inferred − → ε vector field.
Comparison against automated thresholding. To compare the novel CNN against existing methods, we employed automated thresholding to isolate static voxels as described previously 17 . Specifically, we first www.nature.com/scientificreports/ removed low-intensity voxels from the magnitude images corresponding to air. We then removed high-speed (peak speed > 50 cm/s) voxels corresponding to vasculature. We then estimated the correction field using 3rd order polynomial fitting.

Blood flow measurements.
Manual cross-sectional segmentations of vessels of interest were performed by a medical student (SS) with 3 years of experience with neurovascular 4D Flow MRI under the supervision of a board-certified radiologist (AH) with over 10 years of expertise in 4D Flow MRI (Fig. 3). Blood flow was measured at identical cross-sectional segments before and after manual and CNN correction. For the anterior circulation, segmentations of the distal supraclinoid ICA, proximal A1 segment of the ACA, and proximal M1 of the MCA were performed. We note that the regions of measurement in the ICA were distal to the PCOM takeoff and therefore only the ACA and MCA need to be taken into account. For the posterior circulation, segmentations of the distal basilar artery (BA), and proximal bilateral posterior cerebral arteries (PCA) were performed. For the venous circulation, segmentations of the superior sagittal sinus (SSS), straight sinus (SS), and bilateral transverses sinuses (TS) proximal to the confluence of sinuses were performed. Equations to assess inflow-outflow agreement were defined as follows: Statistical analysis. Statistical analysis was performed using RStudio Version 1.3.1056. To assess the relationship of inflow and outflow measurements in each circulation and relationship of corrected and uncorrected flow volume measurements, Bland-Altman analyses and Spearman correlation were performed. Wilcoxonsigned rank tests (WSR) and F-tests were used to assess statistical significance with a type I error rate of 0.05.

Results
Background phase-error. Table 1 summarizes the inflow-outflow error and correlations between inflow and outflow measurements before and after manual phase error correction. Before phase error correction, the mean difference (L/min) between inflow and outflow measurements was − 0.042 with a 95% confidence interval of (− 0.204, 0.118). The Spearman correlation coefficient for inflow and outflow agreement was 0.896. www.nature.com/scientificreports/ The venous circulation had the largest inflow-outflow error with greater bias than the anterior (p < 0.001, WSR) circulation, and greater bias and variance than the posterior (p < 0.001, F-test; p < 0.001, WSR) circulation. The posterior circulation had a smaller variance of inflow-outflow error compared to the anterior circulation (p < 0.001, F-test). However, the posterior circulation also had a larger bias of inflow-outflow error compared to the anterior circulation (p < 0.001, WSR). Figure 4 illustrates the improvements in inflow-outflow error after manual correction. On aggregate, there was a decrease in inflow-outflow error with a decrease in variance (p < 0.001, F-test) and increase in correlation (ρ = 0.896-0.982) between inflow and outflow after manual correction. The bias of inflow-outflow error also significantly decreased after manual correction (p < 0.001, WSR test). For the anterior circulation, there was a decrease in inflow-outflow error with a decrease in variance (p < 0.001, F-test) and increase in correlation (ρ = 0.867-0.981) between inflow and outflow after manual correction. However, the bias (L/min) of inflow-outflow error was -0.009 prior to manual correction and only decreased to -0.005 after manual correction (p = 0.87, WSR). For the posterior circulation, there also was a decrease in inflow-outflow error with a decrease in variance (p < 0.001, F-test) and increase in correlation (ρ = 0.947-0.981) between inflow and outflow after manual correction. The bias between inflow and outflow also significantly decreased after Table 1. Inter-technique comparison of inflow-outflow error at different locations in the brain before and after manual correction. Note: Data in parentheses are Bland-Altman 95% limits of agreement. WSR, Wilcoxonsigned rank test.   www.nature.com/scientificreports/ manual correction (p < 0.001, WSR). For the venous circulation, there also was a decrease in inflow-outflow error with a decrease in variance (p < 0.001, F-test) and increase in correlation (ρ = 0.833-0.945) between inflow and outflow after manual correction. The bias of inflow-outflow error also significantly decreased after manual correction (p < 0.001, WSR). Despite manual correction, the venous circulation had the largest inflow-outflow error with greater bias and variance than the anterior (p < 0.001, F-test; p < 0.001, WSR) and posterior circulation (p < 0.001, F-test; p < 0.001, WSR). Neither the bias nor variance of inflow-outflow error (p = 0.54, F-test; p = 0.23, WSR) was significantly different for the anterior circulation compared to the posterior circulation.

Impact of manual correction.
Visual improvement in background phase gradient with CNN correction. Figures 5 illustrates a representative example of background phase error correction with application of a CNN. The velocity component in the right to left direction is shown for a 33 year old patient with a SM grade 4 AVM in the right basal ganglia. Visually, the observed phase error gradients in the right-left and anterior-posterior directions on the uncorrected phase images are rectified by manual correction. The CNN demonstrates comparable performance to manual correction with equivalent removal of the background phase error gradients. The algorithm removes erroneous background phase, especially near the periphery of the image, while ignoring flow within the AVM and other vascular structures.
Quantitative performance of CNN correction relative to manual correction. Table 2 summarizes the improvement in inflow-outflow error and correlations between inflow and outflow after manual and CNN phase error correction in the test set cases.
After manual correction, there was a decrease in inflow-outflow error with a decrease in variance (p < 0.001, F-test) and increase in correlation (ρ = 0.896-0.982) between inflow and outflow (Fig. 6). There was also a decrease in magnitude of inflow (p < 0.001, WSR) with no significant change in variance (p = 0.366, F-test). There was no significant change in magnitude (p = 0.232, WSR) or variance of outflow (p = 0.366, F-test). The bias of inflowoutflow error also significantly decreased after manual correction (p < 0.001, WSR) (Fig. 6).  Similarly, after CNN correction, there was a decrease in inflow-outflow error with a decrease in variance (p < 0.001, F-test) and increase in correlation (ρ = 0.896 to 0.971) between inflow and outflow. There was a significant reduction in magnitude of inflow (p < 0.001, WSR) but not outflow (p = 0.082, WSR). There was no significant change in variance of inflow (p = 0.530, F-test) or outflow (p = 0.834, F-test). The bias of inflow-outflow error also significantly decreased after CNN correction (p < 0.001, WSR). Figure 6. Bland-Altman, Spearman Correlation, and Box-and-whisker plots compare volumetric inflowoutflow error between aggregate inflow and outflow measurements before and after phase error correction (n = 69). For the Bland-Altman plots, black dashed lines indicate the 95% limits of agreement and red dashed lines indicate mean difference in flow between inflow and outflow. Brackets and asterisks mark statistical significance for comparison of inflow-outflow error between different correction methods (upper: F-test; lower: Wilcoxon-signed Rank Test). After manual, automatic thresholding-based, and CNN correction, there is an improvement in limits of agreement and strength of correlation of inflow-outflow error. There was a significant difference in distribution of flow differences (p = 0.008, F-test) but not bias (p = 0.82, Wilcoxon-signed Rank Test) between inflow and outflow for manually-corrected measurements compared to CNN-corrected measurements. After manual and CNN correction, there was a significant difference in magnitude (p < 0.001, Wilcoxon-signed Rank Test) but not variance of inflow (manual: p = 0.366; CNN: p = 0.530, F-test). There was no significant difference in magnitude or variance of outflow after manual (p = 0.776, F-test; p = 0.232, Wilcoxon-signed Rank Test) or CNN correction (p = 0.834, F-test; p = 0.082, Wilcoxon-signed Rank Test). There was no significant difference in magnitude or variance of inflow (p = 0.783, F-test; p = 0.578, Wilcoxon-signed Rank Test) or outflow (p = 0.621, F-test; p = 0.607, Wilcoxon-signed Rank Test) between manually-corrected measurements compared to CNN = corrected measurements. CNN = convolutional neural network. www.nature.com/scientificreports/ CNN correction performed similarly to manual correction, with no significant difference in either bias (p = 0.82, WSR) or correlation (ρ = 0.982 vs 0.971) between inflow and outflow. However, there was slightly greater variance between inflow and outflow using CNN correction compared to manual correction (p = 0.008, F-test). There was no significant difference in magnitude of inflow (p = 0.578, WSR) and outflow (p = 0.607, WSR), or variance of inflow (p = 0.783, F-test) and outflow (p = 0.621, F-test).
Error-field estimation using automated thresholding also yielded significant reductions in inflow-outflow bias (p < 0.001, WSR) and variance (p < 0.001, F-test) when applied to the uncorrected data. There was no significant differences in inflow-outflow biases between thresholding and CNN (p = 0.162, WSR). However, the variance of inflow-outflow error was significantly greater with thresholding correction relative to CNN correction (p < 0.001, F-test). Additionally, CNN correction yielded higher correlation relative to thresholding correction (ρ = 0.930 vs ρ = 0.971).
Lastly, we found that the mean ± standard deviation of the error fields computed using manual correction was − 22 ± 47 mm/s, − 21 ± 25 mm/s, and 24 ± 34 mm/s for the x-, y-, and z-components of velocity, respectively. Similarly, the mean ± standard deviation of the error fields computed using our CNN method was − 20 ± 48 mm/s, − 15 ± 23 mm/s, and 28 ± 35 mm/s for the x-, y-, and z-components of velocity, respectively. We also performed a pixel-wise comparison between the CNN-and manually-computed error fields (Supplemental Fig. 1). We found very strong pixel-wise correlation between these two methods for each velocity component over the 1.98 billion intracranial voxels within our test set, with Pearson's r ranging from 0.86 to 0.92 (p < 0.001 for each component, Wald test).
Clinical application of CNN background phase error correction. Figure 7 illustrates a clinical application of a CNN to correct background phase error in 4D Flow MRI. In a 35 year old patient with Moymoya Disease, 4D Flow MRI images show asymmetrically decreased blood flow through the right internal carotid artery and perfusion of the right middle cerebral artery territory through an extracranial-intracranial bypass. In addition, blood supply to both the right and left middle cerebral artery territories is quantified within both native vessels and extracranial-intracranial bypass. Flow measurements with CNN background phase error correction are comparable to flow measurements with manual correction.

Discussion
We show in this study two main observations related to background phase error in cerebrovascular 4D Flow MRI. First, we confirm the benefit of image-based phase error correction on inflow-outflow blood flow volume consistency. Second, we show that by leveraging a 3D UNet CNN, it is possible to automate and simplify this phase error correction by directly inferring the correction field. We additionally demonstrate comparable-to-superior performance of our CNN over existing automated thresholding-based methods. This approach has potential to enable more routine clinical use of 4D Flow in the management of patients with cerebrovascular disease and shows the ability of CNNs to concurrently perform two tasks-a visual task of recognizing static soft tissue and estimation of the vector field for phase error correction.
Clinical implementation of 4D Flow MRI has become more feasible with the productization of the pulse sequence, and new indications for its use in the neurovasculature are beginning to emerge. This is now part of the clinical routine at our institution for monitoring treatment response of AVMs after radiosurgery and identifying patients at risk for stroke 5,33 . However, correction of background phase error to ensure accurate 4D Flow MRI measurements remains both challenging and time-consuming 13,19 . Automated background phase error correction is a promising tool to further expand the feasibility of cerebrovascular 4D Flow MRI for routine clinical use.
A variety of methods have been proposed for correction of background phase error correction 7,34,35 , which show similar efficacy to the deep learning algorithm we propose here. These include the use of a stationary phantom and measurements with a proton-based field camera 7,35 . Lorenz. et al. 34 demonstrated improved flow visualization within the superior sagittal sinus after background phase error correction using static tissue velocity modeling. The principal benefit of the software-based fully-automated deep learning approach that we propose here is its ease of implementation.
While our proposed approach is certainly effective, it is not perfect. We observed that inflow-outflow error within the venous circulation were greater than errors within the anterior or posterior circulation. We observed similar results with manual background phase error correction. The reasons for this are not entirely clear. One possibility is that venous vessels are further from the isocenter of the magnet and therefore subject to a larger effect of eddy current-induced background phase error 36 . A second possibility is that superficial veins were not entirely removed when selecting "static" soft tissue for phase-error modeling. However, the scale of these errors was relatively small in our study, most occurring between of 0-0.040 L/min. Lastly, we downsampled our data to 64 × 64 × 64 volumes due to GPU memory constraints and used polynomial fitting to recover spatial resolution; in doing so, we may have limited our CNN's ability to precisely quantify local phase error. Future studies could investigate how to further improve background phase error correction. Notably, with advanced compute power and resources, it may be possible to estimate phase error fields at native resolution.

Limitations
This study has several limitations. Our patient population included patients undergoing 4D Flow MRI for clinical management of cerebral AVMs and did not include normal subjects. All of our studies were performed following administration of intravenous contrast, though it is possible to perform this pulse sequence without contrast. All of the MRIs in this study were performed on a 3T magnet from a single-vendor, which has productized the 4D Flow MRI pulse sequence. It is not clear whether the deep learning algorithm will perform as effectively on each of the many work-in-progress pulse sequences that are available on other vendor platforms. Nevertheless, we www.nature.com/scientificreports/ anticipate that incorporation of additional data from other institutions and scanners, measured across a wider range of VENCs, into the training set will yield a more robust and generalizable algorithm, and is a potential avenue for future work. Additionally, we assessed our algorithm's performance at single planes on each vessel; future work may assess the fidelity of flow consistency across the length of these individual vessels. Because of limited spatial resolution, small arteries such as the ophthalmic artery were not included within inflow-outflow error calculations 37 . Exclusion of these small vessels should affect all analyses equally, whether uncorrected or corrected, and are expected to minimally affect inflow-outflow bias. Lastly, as a proof-of-concept study, we aimed to demonstrate that a CNN-based method could perform phase error correction comparably to manual correction, the clinical standard, and have succeeded in doing so. Future studies may focus on comparing this CNN-based approach against other automated methods, such as static tissue velocity modeling 17,34 and computational fluid-dynamics informed neural networks 38 .

Conclusion
We demonstrate the effect of residual background phase error on volumetric flow measurements in cerebrovascular 4D Flow MRI and demonstrate the benefit of manual image-based phase error correction. Moreover, we show that a 3D-UNet CNN is capable of directly inferring the phase error correction field from 4D Flow image data, and that the automated CNN approach performs comparably to manual image-based correction. Deep learning algorithms such as the one we highlight here have potential to improve the clinical utility of 4D Flow.